package qvanguoobject.test01;

public class VehicleTest {
    public static void main(String[] args) {
        // 实例化一个交通工具对象
        Vehicle vehicle = new Vehicle();

        // 初始化速度和体积
        vehicle.setSpeed(50);
        vehicle.setSize(100);

        // 打印初始值
        System.out.println("初始速度: " + vehicle.getSpeed());
        System.out.println("初始体积: " + vehicle.getSize());

        // 调用移动方法
        vehicle.move();

        // 调用加速方法
        vehicle.speedUp();
        vehicle.move();

        // 再次加速
        vehicle.speedUp();
        vehicle.move();

        // 调用减速方法
        vehicle.speedDown();
        vehicle.move();

        // 再次减速
        vehicle.speedDown();
        vehicle.move();
    }
}
